package com.system.honour.controller;

import com.system.honour.common.ResultDTO;
import com.system.honour.service.RoleUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/sys/role_user")
@Api(tags = "召唤师-角色管理")
@Slf4j
public class RoleUserController {

    @Autowired
    private RoleUserService roleUserService;


    @ApiOperation(value = "根据召唤师id查询对应的召唤师-角色信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId",value = "召唤师id", required = true, paramType = "query",dataType = "Integer")
    })
    @RequestMapping(value = "/getRoleUser",method = RequestMethod.GET)
    public ResultDTO getRoleUserByUserId(Integer userId){
        ResultDTO resultDTO = roleUserService.getRoleUserByUserId(userId);
        return resultDTO;
    }
}
